<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增实体用况')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-interface-add">
            <input type="hidden" name="fbType" value="2"/>
            <input type="hidden" name="pageId" th:value="${pageId}"/>
            <div class="form-group">
                <label class="col-sm-3 control-label">归属服务：</label>
                <div class="col-sm-8">
                    <select name="appType" id="appType" class="form-control m-b" th:with="type=${@dict.getType('appType')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">接口名称：</label>
                <div class="col-sm-8">
                    <input name="interfaceName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">接口描述：</label>
                <div class="col-sm-8">
                    <textarea name="interfaceDescription" class="form-control"></textarea>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required" id="interfaceUrlLabel">接口方法名：</label>
                <div class="col-sm-8">
                    <input name="interfaceUrl" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">归属域：</label>
                <div class="col-sm-8">
                    <input name="domain" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">操作类型：</label>
                <div class="col-sm-8">
                    <select name="optType" class="form-control m-b" th:with="type=${@dict.getType('optType')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group" id="interfaceTypeDiv">
                <label class="col-sm-3 control-label">接口类型：</label>
                <div class="col-sm-8">
                    <select name="interfaceType" id="interfaceType" class="form-control m-b" th:with="type=${@dict.getType('interfaceType')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">特殊接口：</label>
                <div class="col-sm-8">
                    <select name="specialInterface" id="specialInterface" class="form-control m-b" th:with="type=${@dict.getType('specialInterface')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否风险接口：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'isPage_' + dict.dictCode}" name="isRisk" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'isPage_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否分页：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'isPage_' + dict.dictCode}" name="isPage" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'isPage_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">总条数：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <input name="total" class="form-control" type="text">-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">    
                <label class="col-sm-3 control-label">页数：</label>
                <div class="col-sm-8">
                    <input name="page" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">每页大小：</label>
                <div class="col-sm-8">
                    <input name="pageSize" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">非功能需求：</label>
                <div class="col-sm-8">
                    <textarea name="nonFunctionalRequirements" class="form-control"></textarea>
                </div>
            </div>
<!--            <div class="form-group">    -->
<!--                <label class="col-sm-3 control-label">状态：</label>-->
<!--                <div class="col-sm-8">-->
<!--                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">-->
<!--                        <input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">-->
<!--                        <label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="form-group">
                <label class="col-sm-3 control-label">是否返回树形结构：</label>
                <div class="col-sm-8">
                    <select name="isTree" id="isTree" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否边界：</label>
                <div class="col-sm-8">
                    <select name="isBoundary" id="isBoundary" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否公共：</label>
                <div class="col-sm-8">
                    <select name="isCommon" id="isCommon" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否平台：</label>
                <div class="col-sm-8">
                    <select name="isPlatform" id="isPlatform" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">是否管理：</label>
                <div class="col-sm-8">
                    <select name="isManage" id="isManage" class="form-control m-b" th:with="type=${@dict.getType('sys_yes_no')}">
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "interface/interface"
        $("#form-interface-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-interface-add').serialize());
            }
        }
    </script>
</body>
</html>